package com.expand01;

/**
 * Created by yangjun on 2018/3/23.
 */
public class HumanFactory {
    public static <T extends Human> T createHuman(Class c) {
        Human human = null;
        try {
            human = (T)Class.forName(c.getName()).newInstance();
        } catch (Exception e) {
            System.out.println("生成人类错误");
        }
        return (T)human;
    }
}
